package com.econ.powercloud.ems.common.enums;

/**
 * @Author : zjf
 * @Description : SOE状态枚举
 * @Date : 2022/8/3 17:44
 * @Modified by : zjf
 */
public enum SoeStatusType implements EnumMethod{
    OPEN_TO_CLOSE(1,"由分到合"),
    CLOSE_TO_OPEN(2, "由合到分"),
    ;

    private Integer code;
    private String desc;

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getDesc() {
        return desc;
    }

    SoeStatusType(int code, String desc){
        this.code=code;
        this.desc=desc;
    }

    public static String getCodeFromCode(int code){
        for(SoeStatusType type: SoeStatusType.values()){
            if(type.getCode() == code){
                return type.getDesc();
            }
        }
        return null;
    }
}
